package com.rich.live.controller;


import com.rich.live.service.LiveFollowerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author hu
 * @version 1.0
 * @date 2021/08/14 18:51
 */
@RestController
@RequestMapping("/liveFollower")
public class LiveFollowerController {

    @Autowired
    private LiveFollowerService liveFollowerService;

    /**
     * 添加关注人
     * @param id
     * @param uid
     * @param url
     */
    @PostMapping("/addLiveFollower")
    public void addLiveFollower(Long id,Long uid,String url) {
        try {
            liveFollowerService.addLiveFollower(id,uid,url);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * 点赞人数
     * @param id
     * @param num
     */
    @PutMapping("/likeNum")
    public void likeNum(Long id,Integer num){
        liveFollowerService.likeNum(id,num);
    }


}
